package exp1;

import java.util.Scanner;

public class SumN2 {
    public static int sum(int n) {
        if (n > 0) {
            return sum(n - 1) + n;
        }
        return 0;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        // start
        long stime = System.nanoTime();
        System.out.println(sum(n));
        // end
        long etime = System.nanoTime();
        System.out.println(etime - stime);
    }
}
